# encoding: utf-8
from Crypto.Cipher import DES
key = b'zgxwzgxw'   # key需为8字节长度.
des = DES.new(key, DES.MODE_ECB)
text = 'No matter what anybody tells you, words and ideas can change the world.'     
text = text + (8 - (len(text) % 8)) * '='# 被加密的数据需要为8字节的倍数.
print(text)
print(des.encrypt(text.encode()))
print(des.decrypt(des.encrypt(text.encode())))
